package com.eden.manage.dto.agent;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import eden.api.common.enums.AccountTypeEnum;
import eden.api.common.enums.CalTypeEnum;
import eden.api.common.enums.AgentLevelEnum;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class AgentProfitDto {


    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 平台id
     */
    private Long platId;
    private Long platName;

    /**
     * 计算模型，如 百分比和固定金额
     */
    private String calType;
    private String calTypeStr;

    public String getCalTypeStr() {
        return CalTypeEnum.getCalTypeEnum(calType).getDescription();
    }

    /**
     * 账户类型，如上级发展下级分润 ，交易分润。。。。
     */
    private String accType;
    private String accTypeStr;

    public String getAccTypeStr() {
        return AccountTypeEnum.getAccountTypeEnum(accType).getDescription();
    }

    /**
     * 分润值
     */
    private String paramValue;

    /**
     * 平台关系级别
     */
    private Integer paramLevel;
    private String paramLevelStr;

    public String getParamLevelStr() {
        return AgentLevelEnum.getPlatLevelEnum(paramLevel).getDescription();
    }

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
}
